package com.idealighter.game.roomcard.games.mustniuniu.dto;

import com.baidu.bjf.remoting.protobuf.FieldType;
import com.baidu.bjf.remoting.protobuf.annotation.Protobuf;

import java.util.ArrayList;
import java.util.List;

import lombok.Data;

@Data
public class GameInfo {
  @Protobuf(order = 1)
  private int stage; // (0:未开始,1:准备,2:抢庄,3:下注,4:开牌,5展示结果)
  @Protobuf(order = 2)
  private int stageTime; // 本阶段剩余时间(s)
  @Protobuf(order = 3)
  private long preWinBetSelf; // 可推注的选项
  // 用户准备情况
  @Protobuf(order = 4)
  private List<ReadyItem> readyList = new ArrayList<ReadyItem>();
  // 用户叫庄情况
  @Protobuf(order = 5)
  private List<CallDealerItem> callDealerList = new ArrayList<CallDealerItem>();
  // 庄家
  @Protobuf(order = 6)
  private long dealer;
  @Protobuf(order = 7)
  private int callDealerMultiple;
  // 用户下注情况
  @Protobuf(order = 8)
  private List<BetItem> betList = new ArrayList<BetItem>();
  // 我自己的牌
  @Protobuf(order = 9)
  private MySelfCard mySelfCard;
  // 其他已经摊牌的玩家牌
  // 用户摊牌情况（包括结算信息）
  @Protobuf(order = 10)
  private List<ShowCardItem> showCardList = new ArrayList<ShowCardItem>();
  @Protobuf(order = 11) // 最新局结算信息
  private List<RoundBillInfo> billInfos = new ArrayList<>();
  //

  @Data
  public static class ReadyItem {
    @Protobuf(order = 1)
    private int order;
    @Protobuf(order = 2)
    private long playerId;
    @Protobuf(order = 3)
    private int ready;
  }

  @Data
  public static class BetItem {
    @Protobuf(order = 1)
    private int order;
    @Protobuf(order = 2)
    private long playerId;
    // 筹码
    @Protobuf(order = 3)
    private long chips;
    // 买码玩家编号
    @Protobuf(order = 4)
    private long betOtherPlayerId;
    // 买码筹码
    @Protobuf(order = 5)
    private long betOtherChips;
  }

  @Data
  public static class CallDealerItem {
    @Protobuf(order = 1)
    private int order;
    @Protobuf(order = 2)
    private long playerId;
    // 筹码
    @Protobuf(order = 3)
    private int multiple;
  }

  @Data
  public static class MySelfCard {
    @Protobuf(order = 1)
    private int order;
    @Protobuf(order = 2)
    private long playerId;
    @Protobuf(order = 3)
    private int cardsType;
    // 最优牌组合(如果有牛展示为3+2)
    @Protobuf(fieldType = FieldType.INT32, order = 4)
    private List<Integer> bestCards = new ArrayList<>();
    // 牌
    @Protobuf(fieldType = FieldType.INT32, order = 5)
    private List<Integer> cards = new ArrayList<>();
  }

  @Data
  public static class ShowCardItem {
    @Protobuf(order = 1)
    private int order;
    @Protobuf(order = 2)
    private long playerId;
    // 是否摊牌(0:否,1:是)
    @Protobuf(order = 3)
    private int show;
    // 可见牌
    @Protobuf(fieldType = FieldType.INT32, order = 4)
    private List<Integer> cards = new ArrayList<>();
    @Protobuf(order = 5)
    private int cardsType;
  }
}
